// vee-validate一个专门做表单验证的vue插件
import VeeValidate,{Validator} from 'vee-validate'
import Vue from 'vue'
//方言包
import zh_CN from "vee-validate/dist/locale/zh_CN.js";

Vue.use(VeeValidate)
//方言包汉化
Validator.localize('zh_CN', {
    messages: zh_CN.messages,
    attributes: {
      phone: '手机号',
      code: '验证码',
    
    }
  })
Validator.extend("mobile", {
    getMessage: () => `请输入正确的手机号码`,
    validate: value =>{
        return /^1\d{10}$/.test(value)
    }
  });
// /使用方言包
Validator.localize("zh_CN",zh_CN);